<template>
  <div class="body">
    <div class="table_title">设施农业用地备案表</div>
    <div style="text-align: right">
      单位面积:公顷&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    </div>
    <table class="table" cellspacing="0" cellpadding="0">
      <!-- 第一行 -->
      <tr>
        <td class="ds1">地市</td>
        <td class="ds">
          <a-input class="a-input" v-model="city" :disabled="isinput"></a-input>
        </td>
        <td class="td1">县(市、区)</td>
        <td colspan="2">
          <a-input class="a-input" v-model="xian" :disabled="isinput"></a-input>
        </td>
        <td class="td1">乡/镇</td>
        <td colspan="2">
          <a-input class="a-input" :disabled="isipt" v-model="xz"></a-input>
        </td>
        <td class="td1">村</td>
        <td>
          <a-input class="a-input" :disabled="isipt" v-model="cun"></a-input>
        </td>
        <td class="td1">地块数量总计</td>
        <td>
          <a-input
            class="a-input"
            :disabled="isipt"
            v-numeric
            v-model="sumcount"
          ></a-input>
        </td>
      </tr>
      <!-- 第二行 -->
      <tr>
        <td colspan="2" class="td1">项目名称</td>
        <td colspan="6">
          <a-input
            class="a-input"
            placeholder="请填写项目名称"
            :disabled="isipt"
            v-model="projectname"
          ></a-input>
        </td>
        <td class="td1">申请人</td>
        <td colspan="3" v-if="iptype == undefined">
          <a-input class="a-input" :disabled="isipt" v-model="sqname"></a-input>
        </td>
        <td v-if="iptype != undefined">
          <a-input class="a-input" :disabled="isipt" v-model="sqname"></a-input>
        </td>
        <td class="td1" v-if="iptype != undefined">申请电话</td>
        <td v-if="iptype != undefined">
          <a-input
            class="a-input"
            :disabled="isipt"
            v-model="sqphone"
          ></a-input>
        </td>
      </tr>
      <!-- 第三行 -->
      <tr>
        <td colspan="2" class="td1">备案编号</td>
        <td colspan="3">
          <a-input class="a-input" :disabled="isipt" v-model="banum"></a-input>
        </td>
        <td class="td1">备案日期</td>
        <td colspan="2">
          <a-date-picker
            :disabled="isipt"
            format="YYYY-MM-DD "
            placeholder="请选择日期"
            valueFormat="YYYY-MM-DD"
            style="width: 100%"
            v-model="badate"
          />
        </td>
        <td class="td1">生产期限</td>
        <td>
          <a-date-picker
            :disabled="isipt"
            format="YYYY-MM-DD "
            placeholder="请选择日期"
            valueFormat="YYYY-MM-DD"
            style="width: 100%"
            v-model="begindate"
          />
        </td>
        <td class="td1">到</td>
        <td>
          <a-date-picker
            :disabled="isipt"
            format="YYYY-MM-DD "
            placeholder="请选择日期"
            valueFormat="YYYY-MM-DD"
            style="width: 100%"
            v-model="enddate"
          />
        </td>
      </tr>
      <!-- 第四行 -->
      <tr>
        <td colspan="2" class="td1">
          生产规模<span v-if="iptype == undefined">(头、株、只、吨)</span>
        </td>
        <td v-if="iptype != undefined">
          <a-input
            class="a-input"
            :disabled="isipt"
            v-model="scgm"
            v-numeric
          ></a-input>
        </td>
        <td v-if="iptype == undefined" colspan="3">
          <a-input
            class="a-input"
            :disabled="isipt"
            v-model="scgm"
            v-numeric
          ></a-input>
        </td>
        <td colspan="2" v-if="iptype != undefined">
          <a-select
            style="width: 140px"
            placeholder="请选择单位"
            :disabled="isipt"
            v-model="dw"
          >
            <a-select-option value="">请选择单位</a-select-option>
            <a-select-option value="头">头</a-select-option>
            <a-select-option value="株">株</a-select-option>
            <a-select-option value="只">只</a-select-option>
            <a-select-option value="吨">吨</a-select-option>
          </a-select>
        </td>
        <td class="td1">项目总投资(万元)</td>
        <td colspan="2">
          <a-input
            class="a-input"
            :disabled="isipt"
            v-model="sumtz"
            v-numeric
          ></a-input>
        </td>
        <td class="td1">建筑结构</td>
        <td>
          <a-input class="a-input" :disabled="isipt" v-model="jzjg"></a-input>
        </td>
        <td class="td1">层次</td>
        <td>
          <a-select
            style="width: 140px"
            placeholder="请选择层次"
            v-model="xm_jgcc"
            :disabled="isipt"
          >
            <a-select-option value="1">一层</a-select-option>
            <a-select-option value="2">两层</a-select-option>
            <a-select-option value="3">三层</a-select-option>
            <a-select-option value="4">四层</a-select-option>
            <a-select-option value="5">五层</a-select-option>
            <a-select-option value="6">五层及以上</a-select-option>
          </a-select>
        </td>
      </tr>
      <!-- 第五行 -->
      <tr>
        <td rowspan="4" colspan="2" class="td1">设施农业类型</td>
        <td colspan="4">
          <a-checkbox
            class="a-checkbox"
            v-model="ischek"
            @change="zwchange"
            value="作物种植"
            :disabled="isipt"
            >作物种植</a-checkbox
          >
        </td>
        <td colspan="2">
          <a-checkbox
            class="a-checkbox"
            value="zw"
            @click="childrencheckchange"
            v-model="childrencheck"
            :disabled="isipt"
            >作物</a-checkbox
          >
        </td>
        <td colspan="4">
          <a-checkbox-group
            :disabled="isipt"
            v-model="boxcheckedlist"
            @change="childrencheckchange2"
          >
            <a-checkbox value="1001" class="a-checkbox" @click="boxchange">
              粮食
            </a-checkbox>
            <a-checkbox value="1002" @click="boxchange"> 蔬菜 </a-checkbox>
            <a-checkbox value="1003" @click="boxchange"> 花卉 </a-checkbox>
            <a-checkbox value="1004" @click="boxchange"> 水果 </a-checkbox>
            <a-checkbox value="1006" @click="boxchange"> 其他 </a-checkbox>
          </a-checkbox-group>
        </td>
      </tr>
      <tr>
        <td rowspan="3" colspan="4">
          <a-checkbox
            class="a-checkbox"
            v-model="ischek2"
            value="畜禽水产养殖"
            @change="zwchange"
            :disabled="isipt"
          >
            畜禽水产养殖
          </a-checkbox>
        </td>
        <td colspan="2">
          <a-checkbox
            class="a-checkbox"
            :disabled="isipt"
            value="cl"
            v-model="cldata"
            @click="ClCilck"
          >
            畜类</a-checkbox
          >
        </td>
        <td colspan="4">
          <a-checkbox-group
            :disabled="isipt"
            v-model="cllist"
            @change="CLchange"
          >
            <a-checkbox value="2001" class="a-checkbox" @click="Livestock">
              猪
            </a-checkbox>
            <a-checkbox value="2002" @click="Livestock"> 牛 </a-checkbox>
            <a-checkbox value="2003" @click="Livestock"> 羊 </a-checkbox>
            <a-checkbox value="2004" @click="Livestock"> 驴</a-checkbox>
            <a-checkbox value="2006" @click="Livestock"> 兔 </a-checkbox>
            <a-checkbox value="2005" @click="Livestock"> 其他 </a-checkbox>
          </a-checkbox-group>
        </td>
      </tr>
      <tr>
        <td colspan="2">
          <a-checkbox
            class="a-checkbox"
            :disabled="isipt"
            v-model="qldata"
            @click="qlClick"
          >
            禽类
          </a-checkbox>
        </td>
        <td colspan="4">
          <a-checkbox-group
            :disabled="isipt"
            v-model="qllist"
            @change="oultrychange"
          >
            <a-checkbox value="3001" class="a-checkbox" @click="oultry">
              鸡
            </a-checkbox>
            <a-checkbox value="3002" @click="oultry"> 鸭 </a-checkbox>
            <a-checkbox value="3003" @click="oultry"> 鹅 </a-checkbox>
            <a-checkbox value="3006" @click="oultry"> 其他 </a-checkbox>
          </a-checkbox-group>
        </td>
      </tr>
      <tr>
        <td colspan="2">
          <a-checkbox
            class="a-checkbox"
            :disabled="isipt"
            v-model="scdata"
            @click="sClick"
          >
            水产
          </a-checkbox>
        </td>
        <td colspan="4">
          <a-checkbox-group
            :disabled="isipt"
            @change="aquatichange"
            v-model="sclist"
          >
            <a-checkbox value="4001" class="a-checkbox" @click="aquatic">
              鱼类
            </a-checkbox>
            <a-checkbox value="4002" @click="aquatic"> 甲壳类 </a-checkbox>
            <a-checkbox value="4004" @click="aquatic"> 其他 </a-checkbox>
          </a-checkbox-group>
        </td>
      </tr>
      <!-- 第六行 -->
      <tr>
        <td rowspan="4" class="mj">面积</td>
        <td class="td1">农业生产面积</td>
        <td>
          <a-input
            class="a-input"
            :disabled="isipt"
            v-model="nyscmj"
            v-numeric
          ></a-input>
        </td>
        <td class="td1" colspan="2">设施农业申请用地面积</td>
        <td>
          <a-input
            class="a-input"
            :disabled="isipt"
            placeholder="0.00000"
            v-model="nysqmj"
            v-numeric
            @blur="nysqmjblur"
          ></a-input>
        </td>
        <td class="td1" colspan="2">生产用地</td>
        <td>
          <a-input
            class="a-input"
            :disabled="isipt"
            v-model="scmj"
            v-numeric
            @blur="scmiblur"
          ></a-input>
        </td>
        <td class="td1">辅助生产用地</td>
        <td colspan="2">
          <a-input
            class="a-input"
            :disabled="isipt"
            placeholder="0.00000"
            v-model="fzscyd"
            v-numeric
            @blur="fzscydblur"
          ></a-input>
        </td>
      </tr>
      <tr>
        <td class="td1">权属地类</td>
        <td>
          <a-checkbox
            :disabled="isipt"
            class="a-checkbox"
            value="gy"
            v-model="stateowned"
          />
          国有
          <a-checkbox :disabled="isipt" value="jt" v-model="collective" /> 集体
        </td>
        <td class="td1" colspan="2">其中农用地</td>
        <td>
          <a-input
            class="a-input"
            :disabled="isipt"
            v-model="qznyyd"
            v-numeric
          ></a-input>
        </td>
        <td class="td1" colspan="2">使用耕地</td>
        <td>
          <a-input
            class="a-input"
            :disabled="isipt"
            v-model="sygd"
            v-numeric
          ></a-input>
        </td>
        <td class="td1">破坏耕地耕作层</td>
        <td colspan="2">
          <a-input
            class="a-input"
            :disabled="isipt"
            v-model="phgdzc"
            v-numeric
          ></a-input>
        </td>
      </tr>
      <tr>
        <td class="td1" style="width: 120px">使用永久基本农田</td>
        <td colspan="4">
          <a-input
            class="a-input"
            :disabled="isipt"
            v-model="syjbnt"
            v-numeric
          ></a-input>
        </td>
        <td class="td1" colspan="2">破坏永久基本农田耕作层</td>
        <td>
          <a-input
            class="a-input"
            :disabled="isipt"
            v-model="phjbnt"
            v-numeric
          ></a-input>
        </td>
        <td class="td1">计划永久基本农田</td>
        <td colspan="2">
          <a-input
            class="a-input"
            :disabled="isipt"
            v-model="jhyjnt"
            v-numeric
          ></a-input>
        </td>
      </tr>
      <tr v-if="showcheck == false">
        <td class="td1">辅助建设内容</td>
        <td colspan="10">
          <a-checkbox-group :disabled="isipt" v-model="zwlist">
            <a-checkbox value="看护房" class="a-checkbox">看护房 </a-checkbox>
            <a-checkbox value="检验检疫监测" class="a-checkbox"
              >检验检疫监测
            </a-checkbox>
            <a-checkbox value="病虫害防控 " class="a-checkbox"
              >病虫害防控
            </a-checkbox>
            <a-checkbox value="农业灌溉 " class="a-checkbox"
              >农业灌溉
            </a-checkbox>
            <a-checkbox value="农资农机存放场所" class="a-checkbox"
              >农资农机存放场所
            </a-checkbox>
            <a-checkbox value="烘干晒晾" class="a-checkbox"
              >烘干晒晾
            </a-checkbox>
            <a-checkbox value="分拣包装" class="a-checkbox"
              >分拣包装
            </a-checkbox>
            <a-checkbox value="保鲜存储" class="a-checkbox"
              >保鲜存储
            </a-checkbox>
            <a-checkbox value="积肥" class="a-checkbox">积肥 </a-checkbox>
            <span style="display: inline-block; width: 300px; margin-left: 20px"
              >其他:<a-input
                class="a-input"
                style="width: 200px"
                placeholder="其他辅助项目名称"
                v-model="xmfzlxname"
              >
              </a-input
            ></span>
          </a-checkbox-group>
        </td>
      </tr>
      <tr v-if="showcheck == true">
        <td class="td1">辅助建设内容</td>
        <td colspan="10">
          <a-checkbox-group :disabled="isipt" v-model="xqlist">
            <a-checkbox value="检验检疫" class="a-checkbox"
              >检验检疫
            </a-checkbox>
            <a-checkbox value="废弃物处理" class="a-checkbox"
              >废弃物处理
            </a-checkbox>
            <a-checkbox value="消洗转运 " class="a-checkbox"
              >消洗转运
            </a-checkbox>
            <a-checkbox value="冷藏存储 " class="a-checkbox"
              >冷藏存储
            </a-checkbox>
            <a-checkbox value="管理用房" class="a-checkbox"
              >管理用房
            </a-checkbox>
          </a-checkbox-group>
          <span style="display: inline-block; width: 300px; margin-left: 20px"
            >其他:<a-input
              class="a-input"
              v-model="xmfzlxname"
              style="width: 200px"
              placeholder="其他辅助项目名称"
            >
            </a-input
          ></span>
        </td>
      </tr>
    </table>
    <br />
    <div>
      <a-form
        style="margin-left: 0px"
        :label-col="{ span: 4 }"
        :wrapper-col="{ span: 19 }"
        @keyup.enter.native="searchQuery"
      >
        <a-row :gutter="24">
          <a-col
            :xl="8"
            :lg="7"
            :md="8"
            :sm="24"
            v-if="iptype == 'detail' || iptype == 'add'"
          >
            <a-form-item label="填报单位:">
              <a-input :disabled="isipt" v-model="xmLrrdw"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="4" :lg="7" :md="8" :sm="24" v-else> </a-col>
          <a-col :xl="8" :lg="7" :md="8" :sm="24">
            <a-form-item label="填报人:">
              <a-input :disabled="isipt" v-model="informer"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="8" :lg="7" :md="8" :sm="24">
            <a-form-item label="填报时间:">
              <a-date-picker
                :disabled="isipt"
                format="YYYY-MM-DD  HH:mm:ss"
                placeholder="请选择日期"
                valueFormat="YYYY-MM-DD HH:mm:ss"
                class="no-border"
                v-model="tbdatetime"
                style="
                  width: 100%;
                  border: 1px solid #d9d9d9;
                  border-radius: 4px;
                "
              />
            </a-form-item>
          </a-col>
        </a-row>
      </a-form>
    </div>
  </div>
</template>

<script>
import { ssnydlandetial } from "../../../api/api";
export default {
  data() {
    return {
      ischek: false, //作物种植
      childrencheck: false,
      ischek2: false, //畜禽水产养殖
      city: "",
      xian: "",
      isinput: false, //判断地级市和县
      isipt: false, //判断乡镇/村/地级数量总计/项目名称/申请人/申请电话/备案编号/备案日期/生产期限到层次
      iptype: "",
      showcheck: false,
      isboxchecked: false,
      boxcheckedlist: [], //作物下选中的值
      cldata: false, //绑定畜类
      cllist: [], //畜类下选中的值
      qldata: false, //禽类
      qllist: [], //禽类下选中的值
      scdata: false, //水产
      sclist: [], //水产下选中得值
      stateowned: true, //国有
      collective: true, //集体
      projectname: "", //项目名称
      informer: "", //填报人
      zwlist: [],
      xqlist: [],
      xz: "", //乡镇
      cun: "", //村
      sumcount: "", //地块数量总计
      sqname: "", //申请人
      sqphone: "", //申请电话
      banum: "", //备案编号
      badate: "", //备案日期
      begindate: "", //生产日期
      enddate: "", //结束日期
      scgm: "", //生产规模
      dw: "", //单位
      sumtz: "", //项目总投资(万元
      jzjg: "", //建筑结构
      xm_jgcc: "1", //层次
      nyscmj: "", //农业生产面积
      nysqmj: "", //设施农业申请用地面积
      scmj: "", //生产用地
      fzscyd: "", //辅助生产用地
      qznyyd: "", //其中农用地
      sygd: "", //使用耕地
      phgdzc: "", //破坏耕地耕作层
      syjbnt: "", //使用永久基本农田
      phjbnt: "", //破坏永久基本农田耕作层
      jhyjnt: "", //计划永久基本农田
      tbdatetime: "", //填报时间
      xmLrrdw: "", //申请单位
      xmfzlxname: "", //其他
      xmzt: "",
    };
  },
  watch: {
    $route: {
      handler: function (to, from) {
        this.iptype = this.$route.query.type;
      //  location.reload()
       this.Cleardata()
      },
    },
    deep: true,
    immediate: true,
  },
  created() {
    this.iptype = this.$route.query.type;
  },
  mounted() {
    this.iptype = this.$route.query.type;
    this.id = this.$route.query.id;
    this.ISDesabled();
    if (this.$route.query.type == "detail" || this.$route.query.type == "add") {
      this.getdetail();
    }
  },
  methods: {
     //清空数据
     Cleardata(){
        const obj = this
       obj.xz = ''
       obj.ischek = false
       obj.childrencheck = false
       obj.ischek2 = false
       obj.isinput = false
       obj.isipt = false
       obj.iptype = ""
      obj.showcheck = false
      obj.isboxchecked = false
      obj.boxcheckedlist = []
      obj.cldata = false
      obj.cllist = []
      obj.qldata = false
      obj.scdata = false
      obj.qllist = []
      obj.scdat = []
      obj.sclist = []
      obj.stateowned = true
      obj.collective = true
      obj.projectname = ""
      obj.informer= ""
      obj.zwlist= []
      obj.xqlist= []
      obj.xz = ""
      obj.cun = ""
      obj.sumcount = ""
      obj.sqname= ""
      obj.sqphone = ""
      obj.banum = ""
      obj.badate = ""
      obj.begindate =""
      obj.enddate = ""
      obj.scgm = ""
      obj.dw = ""
      obj.sumtz= ""
      obj.jzjg =""
      obj.xm_jgcc = "1"
      obj.nyscmj= ""
      obj.nysqmj = ""
      obj.scmj = ""
      obj.fzscyd= ""
      obj.qznyyd = ""
      obj.sygd = ""
      obj.phgdzc =""
      obj.syjbnt= ""
      obj.phjbnt = ""
      obj.jhyjnt =""
      obj.tbdatetime = ""
      obj.xmLrrdw = ""
      obj.xmfzlxname = ""
      obj.iptype = undefined
    },
    //获取详情数据
    async getdetail() {
      const params = {
        id: this.id,
      };
      const data = await ssnydlandetial(params);
      const res = data.result;
      const xmldata = res.xmXqxl.split(",");
      let arr1 = xmldata.filter((item) => item.startsWith("1"));
      let arr2 = xmldata.filter((item) => item.startsWith("2"));
      let arr3 = xmldata.filter((item) => item.startsWith("3"));
      let arr4 = xmldata.filter((item) => item.startsWith("4"));
      if (data.code == 200 && res.dataSec != "") {
        this.xmzt = res.xmZt;
        this.id = res.dataSec;
        this.projectname = res.xmName;
        this.city = res.xmUsepoint;
        this.xian = res.xmUsepoint1;
        this.xz = res.xmUsepoint2;
        this.cun = res.xmTdsyqname;
        this.informer = res.xmLrrxm;
        this.tbdatetime = res.xmLrrq;
        this.sumcount = res.dkSum;
        this.sqname = res.xmTbrxm;
        this.sqphone = res.xmTbrdh;
        this.banum = res.xmBabh;
        this.badate = res.xmBarq;
        this.begindate = res.xmSxqxstart;
        this.enddate = res.xmSxqxend;
        this.scgm = res.xmScgm;
        this.dw = res.xmScgmdw;
        this.sumtz = res.xmZtz;
        this.jzjg = res.xmJzjgjcc;
        this.xm_jgcc = res.xmJgcc;
        this.ischek = res.xmSsnylx.includes("1") ? true : false;
        this.childrencheck = res.xmXqdl.includes("ZW") ? true : false;
        this.ischek2 = res.xmSsnylx.includes("2") ? true : false;
        this.cldata = res.xmXqdl.includes("CL") ? true : false;
        this.qldata = res.xmXqdl.includes("QL") ? true : false;
        this.scdata = res.xmXqdl.includes("SC") ? true : false;
        this.nyscmj = res.xmNyydmj;
        this.nysqmj = res.xmZydmj;
        this.scmj = res.xmScssydmj;
        this.fzscyd = res.xmFzssydmj;
        this.stateowned =
          res.xmTdxz == null
            ? false
            : res.xmTdxz == "GY" || res.xmTdxz.length == 5
            ? true
            : false;
        this.collective =
          res.xmTdxz == null
            ? false
            : res.xmTdxz == "JT" || res.xmTdxz.length == 5
            ? true
            : false;
        this.qznyyd = res.xmSyndtmj;
        this.sygd = res.xmSygdmj;
        this.phgdzc = res.xmPhgdgzcmj;
        this.syjbnt = res.xmQzjbntmj;
        this.phjbnt = res.xmQzphyjjbntgzcmj;
        this.jhyjnt = res.xmBhyjjbntmj;
        this.xmLrrdw = res.xmLrrdw;
        this.xmfzlxname = res.xmQtfzlxname;
        this.cllist = arr2;
        this.boxcheckedlist = arr1;
        this.qllist = arr3;
        this.sclist = arr4;
        if (res.xmFzssydmjmx != null) {
          let xmdata = res.xmFzssydmjmx.split(",");
          xmdata.includes("检验检疫,废弃物处理");
          console.log(xmdata.includes("检验检疫"), "222");
          console.log(xmdata, "xmdata");

          console.log(this.xqlist, "xqlist");
          if (
            xmdata.includes("检验检疫") == true ||
            xmdata.includes("废弃物处理") == true ||
            xmdata.includes("消洗转运") == true ||
            xmdata.includes("冷藏存储") ||
            xmdata.includes("管理用房")
          ) {
            this.showcheck = true;
            this.xqlist = xmdata;
          } else {
            this.showcheck = false;
            this.zwlist = xmdata;
          }
        }
      }
    },
    //判断需要禁用还是不禁用
    ISDesabled() {
      //获取用户信息
      const usermsg = JSON.parse(localStorage.getItem("user"));
      if (this.$route.query.type != "add") {
        this.informer = usermsg.userid;
      }
      this.xmLrrdw = usermsg.deptname;
      //获取当前时间
      var date = new Date();
      var year = date.getFullYear();
      var month = date.getMonth() + 1;
      var day = date.getDate();
      const hours = date.getHours();
      const minutes = date.getMinutes();
      const seconds = date.getSeconds();

      // 如果需要，可以在小于10的数字前加上0
      const hoursStr = hours < 10 ? "0" + hours : hours;
      const minutesStr = minutes < 10 ? "0" + minutes : minutes;
      const secondsStr = seconds < 10 ? "0" + seconds : seconds;
      const datetime =
        year +
        "-" +
        month +
        "-" +
        day + " " +
        hoursStr +
        ":" +
        minutesStr +
        ":" +
        secondsStr;
      this.tbdatetime = datetime;
      if (usermsg.role == "xian") {
        this.isinput = true;
        this.city = usermsg.city;
        this.xian = usermsg.xian;
      } else if (usermsg.role == "shi" || usermsg.role == "sheng") {
        this.isinput = true;
        this.isipt = true;
      }
    },
    //作物下的事件
    childrencheckchange2(e) {
      console.log(e, "e");
      if (this.ischek == false) {
        this.boxcheckedlist = [];
      }
    },
    //作物事件
    childrencheckchange(e) {
      console.log(this.boxcheckedlist, "ccc");
      if (this.ischek == true) {
        this.childrencheck = !this.childrencheck;
        this.boxcheckedlist = [];
      } else {
        if (this.childrencheck == true) {
          this.boxcheckedlist = [];
          this.childrencheck = false;
        } else {
          e.preventDefault();
        }
      }
    },
    boxchange(e) {
      if (this.childrencheck == false) {
        e.preventDefault();
        this.boxcheckedlist = [];
      } else if (this.ischek == false) {
        this.boxcheckedlist = [];
        this.childrencheck = false;
      }
    },
    //判断时作物种植还是畜禽水产养殖
    zwchange(e, val) {
      if (e.target.value == "作物种植") {
        this.showcheck = e.target.checked == true ? false : true;
        this.ischek != this.ischek;
        this.xqlist = [];
      } else if (e.target.value == "畜禽水产养殖") {
        this.ischek2 != this.ischek2;
        this.showcheck = e.target.checked == true ? true : false;
        this.zwlist = [];
      }
    },

    //畜类点击事件
    ClCilck(e) {
      if (this.ischek2 == true) {
        this.cldata = !this.cldata;
        this.cllist = [];
      } else {
        if (this.cldata == true) {
          this.sclist = [];
          this.qllist = [];
          this.cllist = [];
          this.cldata = false;
          this.qldata = false;
          this.scdata = false;
        } else {
          e.preventDefault();
        }
      }
    },
    Livestock(e) {
      if (this.cldata == false) {
        e.preventDefault();
        this.cllist = [];
      } else if (this.ischek2 == false) {
        this.sclist = [];
        this.qllist = [];
        this.cllist = [];
        this.cldata = false;
        this.qldata = false;
        this.scdata = false;
      }
    },
    CLchange(e) {
      if (this.ischek2 == false) {
        this.cllist = [];
      }
    },
    //禽类点击事件
    qlClick(e) {
      if (this.ischek2 == true) {
        this.qldata = !this.qldata;
        this.qllist = [];
      } else {
        if (this.qldata == true) {
          this.sclist = [];
          this.qllist = [];
          this.cllist = [];
          this.cldata = false;
          this.qldata = false;
          this.scdata = false;
        } else {
          e.preventDefault();
        }
      }
    },
    oultry(e) {
      if (this.qldata == false) {
        e.preventDefault();
        this.qllist = [];
      } else if (this.ischek2 == false) {
        this.sclist = [];
        this.qllist = [];
        this.cllist = [];
        this.cldata = false;
        this.qldata = false;
        this.scdata = false;
      }
    },
    oultrychange() {
      if (this.ischek2 == false) {
        this.qllist = [];
      }
    },
    //水产点击事件
    sClick(e) {
      if (this.ischek2 == true) {
        this.scdata = !this.scdata;
        this.sclist = [];
      } else {
        if (this.scdata == true) {
          this.sclist = [];
          this.qllist = [];
          this.cllist = [];
          this.cldata = false;
          this.qldata = false;
          this.scdata = false;
        } else {
          e.preventDefault();
        }
      }
    },
    aquatic(e) {
      if (this.scdata == false) {
        e.preventDefault();
        this.sclist = [];
      } else if (this.ischek2 == false) {
        this.sclist = [];
        this.qllist = [];
        this.cllist = [];
        this.cldata = false;
        this.qldata = false;
        this.scdata = false;
      }
    },
    aquatichange() {
      if (this.ischek2 == false) {
        this.sclist = [];
      }
    },
    //生产用地失焦事件
    scmiblur(e) {
      console.log(e.target.value, "eee");
      const count = e.target.value;
      this.scmj = Number(count).toFixed(5);
      const a = Number(this.scmj) + Number(this.fzscyd);
      this.nysqmj = a.toFixed(5);
    },
    //辅助生产用地失焦事件
    fzscydblur(e) {
      const count = e.target.value;
      this.fzscyd = Number(count).toFixed(5);
      const b = Number(this.scmj) + Number(this.fzscyd);
      this.nysqmj = b.toFixed(5);
    },
    nysqmjblur(e) {
      const count = e.target.value;
      this.nysqmj = Number(count).toFixed(5);
    },
  },
};
</script>

<style lang="less" scoped>
.body {
  // height: 100vh;
  padding-bottom: 100px;
}
/deep/.ant-calendar-picker-input {
  border: none;
  box-shadow: none;
}
.a-checkbox {
  margin-left: 10px;
}
.table_title {
  text-align: center;
  font-family: 微软雅黑;
  font-weight: 600;
}

.table {
  width: 100%;
  height: 100%;
  td {
    border-collapse: collapse;
    border: 1px solid black;
    text-align: left;
    height: 50px;
    // max-width: 100px;
  }
  .td1 {
    min-width: 80px;
    background-color: #eeeeee;
    font-family: 微软雅黑;
    font-weight: 600;
    text-align: center;
  }
  .ds1 {
    width: 50px;
    background-color: #eeeeee;
    font-family: 微软雅黑;
    font-weight: 600;
    text-align: center;
  }
  .mj {
    width: 30px !important;
    background-color: #eeeeee;
    font-family: 微软雅黑;
    font-weight: 600;
    text-align: center;
  }
  .ds {
    max-width: 100px;
  }
  .a-input {
    border: none;
    // box-shadow: none;
  }
}
</style>